package net.towee.model.repo.impl;

import net.towee.model.repo.DocumentIdentity;
import net.towee.model.repo.DocumentNode;
import net.towee.model.repo.TreeNode;
import net.towee.server.persistence.impl.MongoDbStore;

import com.google.code.morphia.annotations.Entity;
import com.google.code.morphia.annotations.Reference;

/**
 * Implementation of node that have link to document
 * @author c58
 */
@Entity(MongoDbStore.NODES_COLLECTION)
public class DocumentNodeImpl extends NodeDataImpl implements DocumentNode {
	@Reference private DocumentIdentity identity;

	public DocumentNodeImpl() {}
	public DocumentNodeImpl(String id, String groupId, DocumentIdentity identity) {
		super(id, groupId, identity.getName());
		this.identity = identity;
	}
	
	@Override
	public DocumentIdentity getDocumentIdentity() {
		return identity;
	}
	
	@Override
	public DocumentNode toDocumentNode() {
		return this;
	}

	@Override
	public TreeNode toTreeNode() {
		return null;
	}
	
	@Override
	public String getPathForChildren() {
		return null;
	}
}
